package com.example.mainstream.ui.user;

import android.view.View;

import com.bumptech.glide.Glide;
import com.example.shopapp.R;
import com.example.shopapp.bean.Goods;
import com.example.shopapp.bean.Yugou;
import com.example.shopapp.databinding.ActivityGoodsDetailBinding;
import com.example.shopapp.databinding.ActivityYugouDetailBinding;

import cn.project.base.baseui.BaseNormalActivity;

public class YuGouDetailActivity extends BaseNormalActivity<ActivityYugouDetailBinding> {
    Yugou yugou=null;
    @Override
    protected int getLayoutId() {
        return R.layout.activity_yugou_detail;
    }

    @Override
    protected void initView() {
        yugou = (Yugou) getIntent().getSerializableExtra("yugou");
        mBinding.toolbar.rlBack.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
        mBinding.toolbar.tvTitle.setText("商品详情");
    }

    @Override
    protected void initData() {
        Glide.with(this).load(yugou.getUrl()).into(mBinding.image);
        mBinding.tvGoodsTitle.setText(yugou.getTitle());
        mBinding.tvDes.setText(yugou.getContent());
        mBinding.tvType.setText(yugou.getGoods_type());
        mBinding.tvAddress.setText("产地："+yugou.getAddress());
        mBinding.tvDetailAddress.setText("详细地址："+yugou.getDetail_address());
        mBinding.tvPrice.setText("¥："+yugou.getPrice());
    }
}
